﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;

namespace sales.forms
{
    public partial class voucherCashPaymentOther : voucherCashBase
    {
        public voucherCashPaymentOther()
        {
            try
            {
                InitializeComponent();
                dbcrType = debitCredit.debit;
                int mask = common.SysLibs.TurnBitOn(0, CommonTypes.Consts.constFlagPos_VoucherDetailCatCode_PAYMENT);
                (myDetailGrid as sales.Controls.gridVoucherDetail).LoadCatCode1(mask);
            }
            catch (Exception er)
            {
                ShowError(er);
            }
        }
        #region override function
        
        protected override void SetDetailGrid()
        {
            base.SetDetailGrid();
            this.myDetailGrid.SetColumnVisible(new string[] {
                                                sales.Controls.gridVoucherDetail.ColumnNames.saleCode.ToString(), 
                                                sales.Controls.gridVoucherDetail.ColumnNames.custCode.ToString(), 
                                                sales.Controls.gridVoucherDetail.ColumnNames.fAmount.ToString(),
                                                sales.Controls.gridVoucherDetail.ColumnNames.amount.ToString(),
                                                sales.Controls.gridVoucherDetail.ColumnNames.catCode1.ToString(),
                                                sales.Controls.gridVoucherDetail.ColumnNames.notes.ToString()});
            this.myDetailGrid.myAutoFitColumn = sales.Controls.gridVoucherDetail.ColumnNames.notes.ToString();
            this.myDetailGrid.AutoArrange();
        }
        #endregion
        
    }
}
